<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
	<head> 
    <meta charset="UTF-8">
    <%@ include file="/WEB-INF/views/include/head.jsp"%>
    <link rel="stylesheet" href="${ctxStatic}/css/common_erp.css">
    <link rel="stylesheet" href="${ctxStatic}/css/layerSm.css"> 
        <script type="text/javascript">
            //删除项目
            function delCategory(){
                // 调用后台删除方法
                $.post("${ctx}/material/category/delete?id=${category.id}&&oldItemValue=${category.oldItemValue}",'',function(result){
                    // 提示信息
                    tipParent(result.message);
                    // 返回结果
                    if(result.statusCode==STATUSCODEOK){
                        // 刷新页面
                        window.parent.frames[0].searchListForm();
                        closeWin(); 
                     }
                },'json');
            }
        </script>
    </head>
	<body>
	<div class="layerHeader clearfix">
		<p class="headerTitle"><spring:message code="category_show"/></p>
	    <div class="headerButton clearfix">
	    	<shiro:hasPermission name="material:category:edit">
	        <button type="button" onClick="window.location.href='${ctx}/material/category/form?id=${category.id}'"><spring:message code="category_btn_edit"/></button>
	        <button type="button" onclick="del(delCategory)"><spring:message code="category_btn_dele"/></button>
	    	</shiro:hasPermission>
	        <button onclick="closeWin()"><spring:message code="btn_cancle"/></button>
	    </div>
	</div>
    <input type="hidden"  id="listLength" value="${fn:length(categoryList) } "/>
	<div class="smOrderBox">
	    <div class="items clearfix">
	        <!-- 物料分类代码 -->
	        <div class="col-50 clearfix">
	            <p class="tit"><spring:message code="category_show_code"/></p>
	            <p>${category.itemCode}</p>
	        </div>
	        <!-- 分类值 -->
	        <div class="col-50 clearfix">
	            <p class="tit"><spring:message code="category_show_itemValue"/></p>
	            <p>${category.itemValue}</p>
	        </div>
	    </div>
	    <div class="items clearfix">
	        <!-- 中文全称 -->
	        <div class="col-50 clearfix">
	            <p class="tit"><spring:message code="category_show_Cn"/></p>
	            <p data-toggle="tooltip" title="${category.itemNameCn}">${category.itemNameCn}</p>
	        </div>
	        <!-- 英文全称 -->
	        <div class="col-50 clearfix">
	            <p class="tit"><spring:message code="category_show_En"/></p>
	            <p data-toggle="tooltip" title="${category.itemNameEn}">${category.itemNameEn}</p>
	        </div>
	    </div>
	</div>
	<div class="smOrderBox">
	  <div class="items clearfix">
	   <div class="clearfix">
	     <p class="tit"><spring:message code="category_show_sub"/></p>
	     	<div class="tableArea">
			    <!-- 子项目 -->
			    <div class="tableScroll tableScrollSm" style="height:250px;">
			        <table cellpadding="0" class="tableHead">
			            <thead>
			             <tr>
			                 <!-- 项目值 -->
			                 <th><p class="width-185px"><spring:message code="category_show_subItemValue"/></p></th>
			                 <!-- 中文全称 -->
			                 <th><p class="width-250px"><spring:message code="category_show_subCn"/></p></th>
			                 <!-- 英文全称 -->
			                 <th class="width-250px"><p><spring:message code="category_show_subEn"/></p></th>
			             </tr>
			            </thead>
			        </table>
			        <table cellpadding="0" class="tableBody">
			            <tbody>
			                <c:forEach items="${categoryList}" var="categoryList" varStatus="status">
			                    <tr>
			                        <td><p class="width-185px">${categoryList.itemValue}</p></td>
			                        <td><p class="width-250px" data-toggle="tooltip" title="${categoryList.itemNameCn}">${categoryList.itemNameCn}</p></td>
			                        <td class="width-250px"><p data-toggle="tooltip" title="${categoryList.itemNameEn}">${categoryList.itemNameEn}</p></td>
			                    </tr>
			                </c:forEach>
			            </tbody>
			        </table>
			    </div>
		    </div>
	  </div>
	 </div>	
	</div>	
    <div class="smOrderBox">
	    <div class="items clearfix">
	        <!-- 状态 -->
	        <div class="col-50 clearfix">
              <p class="tit"><spring:message code="category_state"/></p>
              <c:choose>
                  <c:when test="${category.enableFlag eq 1}"><p><spring:message code="category_enable"/></p></c:when>
              </c:choose>
              <c:choose>
                  <c:when test="${category.enableFlag eq 0}"><p><spring:message code="category_disable"/></p></c:when>
              </c:choose>
	        </div>
	        <!-- 描述 -->
	        <div class="col-50 clearfix">
               <p class="tit"><spring:message code="category_show_remarks"/></p>
               <p data-toggle="tooltip" title="${category.remarks}">${category.remarks}</p>
	        </div>
	    </div>
	</div>
</html>